Skip to content

[GLUTEN-8232][VL] Allow to enable dynamic openssl link in VCPKG packaging#11444

Merged
zhouyuan merged 11 commits into
apache:mainfrom
zhouyuan:wip_openssl_dynamic
May 28, 2026
Merged

[GLUTEN-8232][VL] Allow to enable dynamic openssl link in VCPKG packaging#11444
zhouyuan merged 11 commits into
apache:mainfrom
zhouyuan:wip_openssl_dynamic

Conversation

@zhouyuan
Copy link
Copy Markdown
Member

@zhouyuan zhouyuan commented Jan 19, 2026

What changes are proposed in this pull request?

This patch enabled dynamic openssl to include FIPS feature in vcpkg build.
The feature is off by default, it can be enabled by set env VCPKG_DYNAMIC_OPENSSL to ON

In the runtime user will need to ensure the libssl.so & libcrypt.so are available otherwise Gluten will fail to run

How was this patch tested?

pass GHA

Related issue: #8232

@zhouyuan zhouyuan force-pushed the wip_openssl_dynamic branch from ce8f244 to b55532a Compare January 19, 2026 14:35
@zhouyuan zhouyuan changed the title [GLUTEN-8232][VL] enable dynamic openssl in vcpkg [GLUTEN-8232][VL] Enable dynamic openssl lib in vcpkg packaging Jan 19, 2026
@zhouyuan zhouyuan requested a review from philo-he January 19, 2026 14:43
@zhouyuan zhouyuan force-pushed the wip_openssl_dynamic branch from 9febdcd to 5079457 Compare January 19, 2026 17:44
Copy link
Copy Markdown
Member

@philo-he philo-he left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comments. Please check if they make sense. Thanks.

Comment thread .github/workflows/velox_backend_x86.yml Outdated
run: |
docker pull apache/gluten:vcpkg-centos-7
docker run -v $GITHUB_WORKSPACE:/work -w /work apache/gluten:vcpkg-centos-7 bash -c "
docker pull apache/gluten:vcpkg-centos-9
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest setting container field with centos 9 image, which is a standard way. I assume it's compatible with GHA checkout.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

endif()

if(PORT STREQUAL "openssl")
set(VCPKG_LIBRARY_LINKAGE dynamic)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use dynamic link only when FIPS is enabled?

My understanding is that FIPS is not a requirement for many users. Then, the current static link for openssl may be good for them.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only enable this when VCPKG_DYNAMIC_OPENSSL is on

@zhouyuan zhouyuan force-pushed the wip_openssl_dynamic branch from aabd20e to 2f47e7d Compare January 20, 2026 18:06
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2026

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions Bot added the stale stale label Mar 7, 2026
@github-actions
Copy link
Copy Markdown

This PR was auto-closed because it has been stalled for 10 days with no activity. Please feel free to reopen if it is still valid. Thanks.

@github-actions github-actions Bot closed this Mar 17, 2026
@FelixYBW
Copy link
Copy Markdown
Contributor

@zhouyuan @philo-he has a fix of #8293

@FelixYBW FelixYBW reopened this May 16, 2026
@github-actions github-actions Bot removed the stale stale label May 17, 2026
@philo-he
Copy link
Copy Markdown
Member

FYI. From what I recall based on my previous investigation, the preferred approach is to dynamically link OpenSSL installed in user's environment to use the FIPS feature, rather than going through vcpkg.

@FelixYBW
Copy link
Copy Markdown
Contributor

FYI. From what I recall based on my previous investigation, the preferred approach is to dynamically link OpenSSL installed in user's environment to use the FIPS feature, rather than going through vcpkg.

I see. Since we didn't specify an absolute path for link, the difference here is only the openssl version liked to Gluten. FIPS is transparent at link time.

Signed-off-by: Yuan <yuanzhou@apache.org>

fix

Signed-off-by: Yuan <yuanzhou@apache.org>

install libcrypto/libssl

Signed-off-by: Yuan <yuanzhou@apache.org>

fix

Signed-off-by: Yuan <yuanzhou@apache.org>
@zhouyuan zhouyuan force-pushed the wip_openssl_dynamic branch from 73d297a to 44b6235 Compare May 25, 2026 14:01
Signed-off-by: Yuan <yuanzhou@apache.org>
@zhouyuan zhouyuan marked this pull request as ready for review May 25, 2026 14:08
zhouyuan added 3 commits May 25, 2026 15:10
Signed-off-by: Yuan <yuanzhou@apache.org>
Signed-off-by: Yuan <yuanzhou@apache.org>
Signed-off-by: Yuan <yuanzhou@apache.org>
@zhouyuan zhouyuan force-pushed the wip_openssl_dynamic branch from eb17800 to 30980cd Compare May 25, 2026 14:33
@github-actions github-actions Bot removed the INFRA label May 25, 2026
zhouyuan added 3 commits May 25, 2026 15:41
Signed-off-by: Yuan <yuanzhou@apache.org>
@github-actions github-actions Bot added the INFRA label May 25, 2026
zhouyuan added 3 commits May 26, 2026 13:39
Signed-off-by: Yuan <yuanzhou@apache.org>
This reverts commit baf5225.
@zhouyuan
Copy link
Copy Markdown
Member Author

with this feature the libvelox.so will link dynamically

ldd cpp/build/releases/libvelox.so
        linux-vdso.so.1 (0x00007ffd4d590000)
        libgluten.so => not found
        libssl.so.3 => /lib64/libssl.so.3 (0x00007ff0e4c7e000)
        libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007ff0dbe00000)
        libm.so.6 => /lib64/libm.so.6 (0x00007ff0dbd23000)
        libc.so.6 => /lib64/libc.so.6 (0x00007ff0dba00000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff0e4d81000)
        libz.so.1 => /lib64/libz.so.1 (0x00007ff0e4c62000)

@zhouyuan zhouyuan requested a review from philo-he May 26, 2026 13:11
@zhouyuan zhouyuan changed the title [GLUTEN-8232][VL] Enable dynamic openssl lib in vcpkg packaging [GLUTEN-8232][VL] Allow to enable dynamic openssl lib in VCPKG packaging May 26, 2026
@zhouyuan zhouyuan changed the title [GLUTEN-8232][VL] Allow to enable dynamic openssl lib in VCPKG packaging [GLUTEN-8232][VL] Allow to enable dynamic openssl link in VCPKG packaging May 26, 2026
@philo-he
Copy link
Copy Markdown
Member

@zhouyuan, thanks for the update. Not sure if my understanding is correct — I'd appreciate any clarification.

I've been trying to understand the practical usage of FIPS-enabled OpenSSL. It seems that in a production environment, the application should link against the OS-provided, FIPS-enabled and certified OpenSSL shared library. If so, are we enabling FIPS in vcpkg primarily for development verification? The certification process is complex and isn't designed to be repeated for every build.

From what I've gathered:
Build time (vcpkg): Use FIPS-enabled OpenSSL for development/testing to ensure the code is FIPS-compatible.
Production: Link against the OS's certified OpenSSL, not the one built from source.

Does this align with the intended approach?

@philo-he
Copy link
Copy Markdown
Member

with this feature the libvelox.so will link dynamically

ldd cpp/build/releases/libvelox.so
        linux-vdso.so.1 (0x00007ffd4d590000)
        libgluten.so => not found
        libssl.so.3 => /lib64/libssl.so.3 (0x00007ff0e4c7e000)
        libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007ff0dbe00000)
        libm.so.6 => /lib64/libm.so.6 (0x00007ff0dbd23000)
        libc.so.6 => /lib64/libc.so.6 (0x00007ff0dba00000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff0e4d81000)
        libz.so.1 => /lib64/libz.so.1 (0x00007ff0e4c62000)

Just to confirm – When using vcpkg to build shared OpenSSL libs, aren't those libs installed under the vcpkg installation directory?

@zhouyuan
Copy link
Copy Markdown
Member Author

zhouyuan commented May 27, 2026

@philo-he In Gluten we only need to enable dynamic linking with openssl when packaging with vcpkg, which is not available in current impl. This patch enabled this feature. Note this is not enabled by default, so all community release won't be impacted

FIPS-enabled OpenSSL

The vender need to provide a fips.so in local runtime, the OS will need to make sure all libs are available on LD_LIBRARY_PATH

When using vcpkg to build shared OpenSSL libs, aren't those libs installed under the vcpkg installation directory?

Right the example here is to demonstrate the different linking at runtime

Copy link
Copy Markdown
Member

@philo-he philo-he left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks. cc @FelixYBW

Not sure if users will prefer linking against OS-installed, certified OpenSSL libs at build time. If so, we could allow bypassing the vcpkg OpenSSL build and let CMake find the system libs instead. Since this isn't determined yet, we can do the follow-up if needed in the future.

Could you document this clearly in a separate PR for users to reference? Perhaps, we can include the following clarifications. Thank you.

  1. At runtime, LD_LIBRARY_PATH should point to the OS-provided OpenSSL package, which includes libssl.so, libcrypto.so, and the FIPS-certified fips.so.
  2. Users should ensure compatibility between the OpenSSL libraries (libssl.so and libcrypto.so) used at link time and those available at runtime. We recommend using the same OpenSSL version for both to avoid potential issues.

@FelixYBW
Copy link
Copy Markdown
Contributor

LGTM. Thanks. cc @FelixYBW

Not sure if users will prefer linking against OS-installed, certified OpenSSL libs at build time. If so, we could allow bypassing the vcpkg OpenSSL build and let CMake find the system libs instead. Since this isn't determined yet, we can do the follow-up if needed in the future.

Could you document this clearly in a separate PR for users to reference? Perhaps, we can include the following clarifications. Thank you.

  1. At runtime, LD_LIBRARY_PATH should point to the OS-provided OpenSSL package, which includes libssl.so, libcrypto.so, and the FIPS-certified fips.so.
  2. Users should ensure compatibility between the OpenSSL libraries (libssl.so and libcrypto.so) used at link time and those available at runtime. We recommend using the same OpenSSL version for both to avoid potential issues.

@philo-he, you are right. Ideally, we should link to libssl in the target system. We have below choices:

  1. link the version in vcpkg, load the same system version on target machine. -- no issue
  2. link the version in vcpkg, load different system versions on target machine. -- potential issue
  3. link the version in vcpkg, release the libssl.so in vcpkg with Gluten jar together, set LD_LIBRARY_PATH to the released one -- no issue.
  4. link the version in dev system, load the same version on target machine. -- no issue.
  5. link the version in dev system, load different version on target machine. -- potential issue

If 2 or 5 happens, developer either need to update the version in vcpkg/dev system or the one on target system.

We just think openssl is stable enough, linking with vcpkg is much easier than system one. Let's try this solution first, and switch to yours once we encounter issues.

@zhouyuan zhouyuan merged commit b0ca60a into apache:main May 28, 2026
65 checks passed
@FelixYBW
Copy link
Copy Markdown
Contributor

@zhouyuan can you add the config to https://github.com/apache/gluten/blob/main/docs/get-started/build-guide.md? Also list the openssl version in vcpkg?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants